<script>
export default {
  name: 'AuthButton',
  props: {
    btnString: {
      type: String,
      default: ''
    }
  },
  computed: {
    isShow() {
      const perms = this.$store.state.user.profile.permissions
      return perms.includes(this.btnString) || perms.includes('*:*:*')
    }
  },
  render() {
    // 根据权限判断是否渲染按钮
    return this.isShow && this.$slots.default
  }
}
</script>
